<%--
 * list.jsp
 *
 * Copyright (C) 2013 Universidad de Sevilla
 * 
 * The use of this project is hereby constrained to the conditions of the 
 * TDG Licence, a copy of which you may download from 
 * http://www.tdg-seville.info/License.html
 --%>

<%@page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<%@taglib prefix="jstl" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@taglib prefix="security"
	uri="http://www.springframework.org/security/tags"%>
<%@taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@taglib prefix="acme" tagdir="/WEB-INF/tags"%>


<display:table pagesize="5" class="displaytag" keepStatus="true"
	name="projects" requestURI="${requestURI}" id="row">

	<security:authorize access="hasRole('USER')">
		<display:column>
			<a href="project/user/edit.do?projectId=${row.id}"><spring:message
					code="project.view" /></a>
		</display:column>

	</security:authorize>

	<spring:message code="project.title" var="titleHeader" />
	<display:column property="title" title="${titleHeader}"
		sortable="false" />

	<spring:message code="project.creationMoment" var="creationMomentHeader" />
	<display:column property="creationMoment"
		title="${creationMomentHeader}" sortable="false"
		format="{0,date,dd/MM/yyyy HH:mm}" />

			
			<spring:message code="project.workUpdate.amountOfWork" var="amountHeader" />
			<display:column property="totalAmountOfWork" title="${amountHeader}"
			sortable="false" />
			 
	<spring:message code="project.joinable"
		var="joinableHeader" />
		<jstl:if test="${row.status == 'Recruiting'}">
			<spring:message code="project.yes" var = "aux"/>
		</jstl:if>
		<jstl:if test="${row.status != 'Recruiting'}">
			<spring:message code="project.no" var = "aux"/>
		</jstl:if>
		<display:column value="${aux }" title="${joinableHeader}" sortable="false" />
</display:table>

<!-- Action links -->

<security:authorize access="hasRole('USER')">

	<a href="project/user/create.do"><spring:message
			code="project.create" /></a>

</security:authorize>

<security:authorize access="hasRole('ADMINISTRATOR')">
	<acme:cancel code="project.goBack" url="${backURI}" />
</security:authorize>

<security:authorize access="hasRole('USER')">
	<acme:cancel code="project.goBack" url="${backURI}" />
</security:authorize>

<security:authorize access="isAnonymous()">
	<acme:cancel code="project.goBack" url="${backURI}" />
</security:authorize>

